public class Player {

	Direction dir;

	private Field position;

	public Player(Field p) {
		position = p;

	}

	public void enter(Direction d) {
		switch (d) {

		case NORTH:
			if (position.get_b_north() == Barrier.WALL) {
				System.out.println("wall");
			} else {
				position = position.get_north();
			}
			break;

		case EAST:
			if (position.get_b_east() == Barrier.WALL) {
				System.out.println("wall");
			} else {
				position = position.get_east();
			}
			break;

		case SOUTH:
			if (position.get_b_south() == Barrier.WALL) {
				System.out.println("wall");
			} else {
				position = position.get_south();
			}
			break;

		case WEST:
			if (position.get_b_west() == Barrier.WALL) {
				System.out.println("wall");
			} else {
				position = position.get_west();
			}
			break;
		}
	}

	public String toString() {
		// if(position.get_id() != null)
		return "" + position.get_id();
	}
}
